﻿#ifndef REGISTER_WIDGET_H
#define REGISTER_WIDGET_H

#include <QWidget>
#include <QDebug>
#include <QMenu>
#include <QMouseEvent>
#include <QMessageBox>

#include "alltools.h"

namespace Ui {
class register_widget;
}

class register_widget : public QWidget
{
    Q_OBJECT

public:
    explicit register_widget(QWidget *parent = nullptr);
    ~register_widget();
    QMap<QString,QString> UserInfo;

private slots:
    void on_pushButtonRegister_clicked();

    void on_pushButtonBack_clicked();

    void on_pushButtonGetID_clicked();

    void on_pushButtonGetFace_clicked();

signals:
    void RetoMainfunc(QMap<QString,QString> res);
    void RetoLogin();

private:
    Ui::register_widget *ui;
    std::string useId;
    cv::Mat imgPeople_t;
    cv::Mat imgUser_t;
    QMessageBox OK;
    QMessageBox OK0;
    QMessageBox OK1;
    QMessageBox OK2;
    QMessageBox OK3;
    QMessageBox NO;
    QMessageBox NO1;

    void putUserInfo();
    bool checkFace();
    void ConnectSlots();

    int status;

protected:
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
    void mouseReleaseEvent(QMouseEvent *e);

private:
    QPoint last;
};


#endif // REGISTER_WIDGET_H
